﻿using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Controls;

using NetBay.Core.BusinessEntities.Versioning;

using Rio.Manager.Application.ViewModel.FolderTypeAdministration;

using Telerik.Windows.Controls;

namespace Rio.Manager.Application.Views
{
    public partial class ListUndoCheckOutTabView : UserControl
    {
        #region Constructors

        public ListUndoCheckOutTabView()
        {
            InitializeComponent();
        }

        #endregion Constructors

        #region Methods

        /// <summary>
        /// Handles the SelectionChanged event of the radGridView control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Windows.Controls.SelectionChangeEventArgs"/> instance containing the event data.</param>
        private void radGridView_SelectionChanged(object sender, SelectionChangeEventArgs e)
        {
            (DataContext as ListUndoCheckOutTabViewModel).SelectedUsers = new ObservableCollection<VersioningItem>(radGridView.SelectedItems.Cast<VersioningItem>());
        }

        #endregion Methods
    }
}